home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1990 September: Essentials 4 / ADC Developer CD (1990-09) [Essentials 4]_iso / Developer Essentials 4.iso / d e v e l o p / develop 1 code / Compatibility / compatibility.c < prev    next >
MacBinary  |  1989-10-16  |  4.9 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Oct 16 15:42:06 1989, modified Mon Oct 16 15:42:06 1989, creator 'MPS ', type ASCII, 4439 bytes "compatibility.c" , at 0x11d7 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 63 6f 6d 70 61 74 | 69 62 69 6c 69 74 79 2e |..compat|ibility.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 01 00 69 00 |.TEXTMPS| .....i.|
|00000050| 00 00 00 00 00 11 57 00 | 00 01 7e a1 5f df 8e a1 |......W.|..~._...|
|00000060| 5f df 8e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |_.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 a8 2f 00 00 |........|...../..|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 3c 45 76 65 6e 74 73 |#include| <Events|
|00000090| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 4f 53 |.h>.#inc|lude <OS|
|000000a0| 45 76 65 6e 74 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |Events.h|>.#inclu|
|000000b0| 64 65 20 3c 4f 53 55 74 | 69 6c 73 2e 68 3e 0d 23 |de <OSUt|ils.h>.#|
|000000c0| 69 6e 63 6c 75 64 65 20 | 3c 44 69 61 6c 6f 67 73 |include |<Dialogs|
|000000d0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 50 61 |.h>.#inc|lude <Pa|
|000000e0| 63 6b 61 67 65 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |ckages.h|>.#inclu|
|000000f0| 64 65 20 3c 52 65 74 72 | 61 63 65 2e 68 3e 0d 23 |de <Retr|ace.h>.#|
|00000100| 69 6e 63 6c 75 64 65 20 | 3c 54 72 61 70 73 2e 68 |include |<Traps.h|
|00000110| 3e 0d 0d 23 64 65 66 69 | 6e 65 09 49 4e 54 45 52 |>..#defi|ne.INTER|
|00000120| 56 41 4c 09 09 36 0d 23 | 64 65 66 69 6e 65 20 72 |VAL..6.#|define r|
|00000130| 49 6e 66 6f 44 69 61 6c | 6f 67 09 31 34 30 0d 23 |InfoDial|og.140.#|
|00000140| 64 65 66 69 6e 65 20 72 | 53 74 61 74 54 65 78 74 |define r|StatText|
|00000150| 49 74 65 6d 09 32 0d 0d | 2f 2a 0d 20 2a 20 20 54 |Item.2..|/*. * T|
|00000160| 68 65 73 65 20 61 72 65 | 20 67 6c 6f 62 61 6c 73 |hese are| globals|
|00000170| 20 77 68 69 63 68 20 77 | 69 6c 6c 20 62 65 20 72 | which w|ill be r|
|00000180| 65 66 65 72 65 6e 63 65 | 64 20 66 72 6f 6d 20 6f |eference|d from o|
|00000190| 75 72 20 56 42 4c 20 54 | 61 73 6b 0d 20 2a 2f 0d |ur VBL T|ask. */.|
|000001a0| 6c 6f 6e 67 09 67 43 6f | 75 6e 74 65 72 3b 09 09 |long.gCo|unter;..|
|000001b0| 2f 2a 20 43 6f 75 6e 74 | 65 72 20 69 6e 63 72 65 |/* Count|er incre|
|000001c0| 6d 65 6e 74 65 64 20 65 | 61 63 68 20 74 69 6d 65 |mented e|ach time|
|000001d0| 20 6f 75 72 20 56 42 4c | 20 67 65 74 73 20 63 61 | our VBL| gets ca|
|000001e0| 6c 6c 65 64 20 2a 2f 0d | 0d 2f 2a 0d 20 2a 20 20 |lled */.|./*. * |
|000001f0| 44 65 66 69 6e 65 20 61 | 20 73 74 72 75 63 74 20 |Define a| struct |
|00000200| 74 6f 20 6b 65 65 70 20 | 74 72 61 63 6b 20 6f 66 |to keep |track of|
|00000210| 20 77 68 61 74 20 77 65 | 20 6e 65 65 64 2e 20 20 | what we| need. |
|00000220| 50 75 74 20 74 68 65 56 | 42 4c 54 61 73 6b 20 69 |Put theV|BLTask i|
|00000230| 6e 74 6f 20 74 68 65 20 | 0d 20 2a 20 20 73 74 72 |nto the |. * str|
|00000240| 75 63 74 20 66 69 72 73 | 74 20 62 65 63 61 75 73 |uct firs|t becaus|
|00000250| 65 20 69 74 73 20 61 64 | 64 72 65 73 73 20 77 69 |e its ad|dress wi|
|00000260| 6c 6c 20 62 65 20 70 61 | 73 73 65 64 20 74 6f 20 |ll be pa|ssed to |
|00000270| 6f 75 72 20 56 42 4c 20 | 74 61 73 6b 20 69 6e 20 |our VBL |task in |
|00000280| 41 30 0d 20 2a 2f 0d 73 | 74 72 75 63 74 20 56 42 |A0. */.s|truct VB|
|00000290| 4c 52 65 63 20 7b 0d 09 | 56 42 4c 54 61 73 6b 09 |LRec {..|VBLTask.|
|000002a0| 74 68 65 56 42 4c 54 61 | 73 6b 3b 09 2f 2a 20 74 |theVBLTa|sk;./* t|
|000002b0| 68 65 20 56 42 4c 20 74 | 61 73 6b 20 69 74 73 65 |he VBL t|ask itse|
|000002c0| 6c 66 20 2a 2f 0d 09 6c | 6f 6e 67 09 56 42 4c 41 |lf */..l|ong.VBLA|
|000002d0| 35 3b 09 09 2f 2a 20 73 | 61 76 65 64 20 43 75 72 |5;../* s|aved Cur|
|000002e0| 72 65 6e 74 41 35 20 77 | 68 65 72 65 20 77 65 20 |rentA5 w|here we |
|000002f0| 63 61 6e 20 66 69 6e 64 | 20 69 74 20 2a 2f 0d 7d |can find| it */.}|
|00000300| 3b 0d 74 79 70 65 64 65 | 66 20 73 74 72 75 63 74 |;.typede|f struct|
|00000310| 20 56 42 4c 52 65 63 20 | 56 42 4c 52 65 63 2c 20 | VBLRec |VBLRec, |
|00000320| 2a 56 42 4c 52 65 63 50 | 74 72 3b 0d 0d 2f 2a 0d |*VBLRecP|tr;../*.|
|00000330| 20 2a 09 47 65 74 56 42 | 4c 52 65 63 20 72 65 74 | *.GetVB|LRec ret|
|00000340| 75 72 6e 73 20 74 68 65 | 20 61 64 64 72 65 73 73 |urns the| address|
|00000350| 20 6f 66 20 74 68 65 20 | 56 42 4c 52 65 63 20 61 | of the |VBLRec a|
|00000360| 73 73 6f 63 69 61 74 65 | 64 20 77 69 74 68 20 6f |ssociate|d with o|
|00000370| 75 72 20 56 42 4c 20 74 | 61 73 6b 2e 0d 20 2a 20 |ur VBL t|ask.. * |
|00000380| 20 54 68 69 73 20 77 6f | 72 6b 73 20 62 65 63 61 | This wo|rks beca|
|00000390| 75 73 65 20 6f 6e 20 65 | 6e 74 72 79 20 69 6e 74 |use on e|ntry int|
|000003a0| 6f 20 74 68 65 20 56 42 | 4c 20 74 61 73 6b 2c 20 |o the VB|L task, |
|000003b0| 41 30 20 70 6f 69 6e 74 | 73 20 74 6f 20 74 68 65 |A0 point|s to the|
|000003c0| 20 74 68 65 56 42 4c 54 | 61 73 6b 0d 20 2a 20 20 | theVBLT|ask. * |
|000003d0| 66 69 65 6c 64 20 69 6e | 20 74 68 65 20 56 42 4c |field in| the VBL|
|000003e0| 52 65 63 20 72 65 63 6f | 72 64 2c 20 77 68 69 63 |Rec reco|rd, whic|
|000003f0| 68 20 69 73 20 74 68 65 | 20 66 69 72 73 74 20 66 |h is the| first f|
|00000400| 69 65 6c 64 20 69 6e 20 | 74 68 65 20 72 65 63 6f |ield in |the reco|
|00000410| 72 64 20 61 6e 64 20 0d | 20 2a 20 20 69 73 20 74 |rd and .| * is t|
|00000420| 68 65 20 61 64 64 72 65 | 73 73 20 77 65 20 72 65 |he addre|ss we re|
|00000430| 74 75 72 6e 2e 20 20 4e | 6f 74 65 20 74 68 61 74 |turn. N|ote that|
|00000440| 20 74 68 69 73 20 6d 65 | 74 68 6f 64 20 77 6f 72 | this me|thod wor|
|00000450| 6b 73 20 77 68 65 74 68 | 65 72 20 74 68 65 20 56 |ks wheth|er the V|
|00000460| 42 4c 52 65 63 0d 20 2a | 20 20 69 73 20 61 6c 6c |BLRec. *| is all|
|00000470| 6f 63 61 74 65 64 20 67 | 6c 6f 62 61 6c 6c 79 2c |ocated g|lobally,|
|00000480| 20 69 6e 20 74 68 65 20 | 68 65 61 70 20 28 61 73 | in the |heap (as|
|00000490| 20 6c 6f 6e 67 20 61 73 | 20 74 68 65 20 72 65 63 | long as| the rec|
|000004a0| 6f 72 64 20 69 73 20 6c | 6f 63 6b 65 64 20 69 6e |ord is l|ocked in|
|000004b0| 20 0d 20 2a 20 20 6d 65 | 6d 6f 72 79 29 20 6f 72 | . * me|mory) or|
|000004c0| 20 69 66 20 69 74 20 69 | 73 20 61 6c 6c 6f 63 61 | if it i|s alloca|
|000004d0| 74 65 64 20 6f 6e 20 74 | 68 65 20 73 74 61 63 6b |ted on t|he stack|
|000004e0| 20 61 73 20 69 73 20 74 | 68 65 20 63 61 73 65 20 | as is t|he case |
|000004f0| 69 6e 20 74 68 69 73 20 | 65 78 61 6d 70 6c 65 2e |in this |example.|
|00000500| 0d 20 2a 20 20 49 6e 20 | 74 68 65 20 6c 61 74 74 |. * In |the latt|
|00000510| 65 72 20 63 61 73 65 20 | 74 68 69 73 20 69 73 20 |er case |this is |
|00000520| 4f 4b 20 61 73 20 6c 6f | 6e 67 20 61 73 20 74 68 |OK as lo|ng as th|
|00000530| 65 20 70 72 6f 63 65 64 | 75 72 65 20 77 68 69 63 |e proced|ure whic|
|00000540| 68 20 69 6e 73 74 61 6c | 6c 65 64 20 74 68 65 0d |h instal|led the.|
|00000550| 20 2a 20 20 74 61 73 6b | 20 64 6f 65 73 20 6e 6f | * task| does no|
|00000560| 74 20 65 78 69 74 20 77 | 68 69 6c 65 20 74 68 65 |t exit w|hile the|
|00000570| 20 74 61 73 6b 20 69 73 | 20 72 75 6e 6e 69 6e 67 | task is| running|
|00000580| 2e 20 20 54 68 69 73 20 | 74 72 69 63 6b 20 61 6c |. This |trick al|
|00000590| 6c 6f 77 73 20 75 73 20 | 74 6f 20 67 65 74 0d 20 |lows us |to get. |
|000005a0| 2a 20 20 74 6f 20 74 68 | 65 20 73 61 76 65 64 20 |* to th|e saved |
|000005b0| 41 35 2c 20 62 75 74 20 | 69 74 20 63 6f 75 6c 64 |A5, but |it could|
|000005c0| 20 61 6c 73 6f 20 62 65 | 20 75 73 65 64 20 74 6f | also be| used to|
|000005d0| 20 67 65 74 20 74 6f 20 | 61 6e 79 74 68 69 6e 67 | get to |anything|
|000005e0| 20 77 65 20 77 61 6e 74 | 65 64 20 74 6f 0d 20 2a | we want|ed to. *|
|000005f0| 20 20 73 74 6f 72 65 20 | 69 6e 20 74 68 65 20 72 | store |in the r|
|00000600| 65 63 6f 72 64 2e 0d 20 | 20 2a 2f 0d 56 42 4c 52 |ecord.. | */.VBLR|
|00000610| 65 63 50 74 72 20 47 65 | 74 56 42 4c 52 65 63 20 |ecPtr Ge|tVBLRec |
|00000620| 28 29 0d 09 3d 20 30 78 | 32 30 30 38 3b 09 09 09 |()..= 0x|2008;...|
|00000630| 2f 2a 20 4d 4f 56 45 2e | 4c 09 41 30 2c 44 30 20 |/* MOVE.|L.A0,D0 |
|00000640| 2a 2f 0d 0d 2f 2a 0d 20 | 2a 20 20 44 6f 56 42 4c |*/../*. |* DoVBL|
|00000650| 20 69 73 20 63 61 6c 6c | 65 64 20 6f 6e 6c 79 20 | is call|ed only |
|00000660| 62 79 20 53 74 61 72 74 | 56 42 4c 20 28 29 0d 20 |by Start|VBL (). |
|00000670| 2a 2f 0d 76 6f 69 64 20 | 44 6f 56 42 4c 20 28 56 |*/.void |DoVBL (V|
|00000680| 52 50 29 0d 56 42 4c 52 | 65 63 50 74 72 09 56 52 |RP).VBLR|ecPtr.VR|
|00000690| 50 3b 0d 7b 0d 09 67 43 | 6f 75 6e 74 65 72 2b 2b |P;.{..gC|ounter++|
|000006a0| 3b 09 09 09 09 09 09 2f | 2a 20 53 68 6f 77 20 77 |;....../|* Show w|
|000006b0| 65 20 63 61 6e 20 73 65 | 74 20 61 20 67 6c 6f 62 |e can se|t a glob|
|000006c0| 61 6c 20 2a 2f 0d 09 56 | 52 50 2d 3e 74 68 65 56 |al */..V|RP->theV|
|000006d0| 42 4c 54 61 73 6b 2e 76 | 62 6c 43 6f 75 6e 74 20 |BLTask.v|blCount |
|000006e0| 3d 20 49 4e 54 45 52 56 | 41 4c 3b 09 2f 2a 20 53 |= INTERV|AL;./* S|
|000006f0| 65 74 20 6f 75 72 73 65 | 6c 76 65 73 20 74 6f 20 |et ourse|lves to |
|00000700| 72 75 6e 20 61 67 61 69 | 6e 20 2a 2f 0d 7d 0d 0d |run agai|n */.}..|
|00000710| 2f 2a 0d 20 2a 20 20 54 | 68 69 73 20 69 73 20 74 |/*. * T|his is t|
|00000720| 68 65 20 61 63 74 75 61 | 6c 20 56 42 4c 20 74 61 |he actua|l VBL ta|
|00000730| 73 6b 20 63 6f 64 65 2e | 20 20 49 74 20 75 73 65 |sk code.| It use|
|00000740| 73 20 47 65 74 56 42 4c | 52 65 63 20 74 6f 20 67 |s GetVBL|Rec to g|
|00000750| 65 74 20 6f 75 72 20 56 | 42 4c 20 72 65 63 6f 72 |et our V|BL recor|
|00000760| 64 0d 20 2a 20 20 61 6e | 64 20 70 72 6f 70 65 72 |d. * an|d proper|
|00000770| 6c 79 20 73 65 74 20 75 | 70 20 41 35 2e 20 20 48 |ly set u|p A5. H|
|00000780| 61 76 69 6e 67 20 64 6f | 6e 65 20 74 68 61 74 2c |aving do|ne that,|
|00000790| 20 69 74 20 63 61 6c 6c | 73 20 44 6f 56 42 4c 20 | it call|s DoVBL |
|000007a0| 74 6f 20 69 6e 63 72 65 | 6d 65 6e 74 20 61 0d 20 |to incre|ment a. |
|000007b0| 2a 20 20 67 6c 6f 62 61 | 6c 20 63 6f 75 6e 74 65 |* globa|l counte|
|000007c0| 72 20 61 6e 64 20 73 65 | 74 73 20 69 74 73 65 6c |r and se|ts itsel|
|000007d0| 66 20 74 6f 20 72 75 6e | 20 61 67 61 69 6e 2e 20 |f to run| again. |
|000007e0| 20 42 65 63 61 75 73 65 | 20 6f 66 20 74 68 65 20 | Because| of the |
|000007f0| 76 61 67 61 72 69 65 73 | 20 6f 66 20 0d 20 2a 20 |vagaries| of . * |
|00000800| 20 4d 50 57 20 43 20 33 | 2e 30 20 6f 70 74 69 6d | MPW C 3|.0 optim|
|00000810| 69 7a 61 74 69 6f 6e 2c | 20 69 74 20 63 61 6c 6c |ization,| it call|
|00000820| 73 20 61 20 73 65 70 61 | 72 61 74 65 20 72 6f 75 |s a sepa|rate rou|
|00000830| 74 69 6e 65 20 74 6f 20 | 61 63 74 75 61 6c 6c 79 |tine to |actually|
|00000840| 20 61 63 63 65 73 73 20 | 0d 20 2a 20 20 67 6c 6f | access |. * glo|
|00000850| 62 61 6c 20 76 61 72 69 | 61 62 6c 65 73 2e 20 20 |bal vari|ables. |
|00000860| 53 65 65 20 54 65 63 68 | 20 4e 6f 74 65 20 23 32 |See Tech| Note #2|
|00000870| 30 38 20 2d 20 22 53 65 | 74 74 69 6e 67 20 61 6e |08 - "Se|tting an|
|00000880| 64 20 52 65 73 74 6f 72 | 69 6e 67 20 41 35 22 20 |d Restor|ing A5" |
|00000890| 66 6f 72 20 74 68 65 20 | 0d 20 2a 20 20 72 65 61 |for the |. * rea|
|000008a0| 73 6f 6e 73 20 66 6f 72 | 20 74 68 69 73 2c 20 61 |sons for| this, a|
|000008b0| 73 20 77 65 6c 6c 20 61 | 73 20 66 6f 72 20 61 20 |s well a|s for a |
|000008c0| 64 65 73 63 72 69 70 74 | 69 6f 6e 20 6f 66 20 53 |descript|ion of S|
|000008d0| 65 74 41 35 2e 0d 20 2a | 2f 0d 76 6f 69 64 20 53 |etA5.. *|/.void S|
|000008e0| 74 61 72 74 56 42 4c 20 | 28 29 0d 7b 0d 09 6c 6f |tartVBL |().{..lo|
|000008f0| 6e 67 09 09 63 75 72 41 | 35 3b 0d 09 56 42 4c 52 |ng..curA|5;..VBLR|
|00000900| 65 63 50 74 72 09 72 65 | 63 50 74 72 3b 0d 09 0d |ecPtr.re|cPtr;...|
|00000910| 09 72 65 63 50 74 72 20 | 3d 20 47 65 74 56 42 4c |.recPtr |= GetVBL|
|00000920| 52 65 63 20 28 29 3b 09 | 09 2f 2a 20 46 69 72 73 |Rec ();.|./* Firs|
|00000930| 74 20 67 65 74 20 6f 75 | 72 20 72 65 63 6f 72 64 |t get ou|r record|
|00000940| 20 2a 2f 0d 09 63 75 72 | 41 35 20 3d 20 53 65 74 | */..cur|A5 = Set|
|00000950| 41 35 20 28 72 65 63 50 | 74 72 2d 3e 56 42 4c 41 |A5 (recP|tr->VBLA|
|00000960| 35 29 3b 2f 2a 20 47 65 | 74 20 74 68 65 20 73 61 |5);/* Ge|t the sa|
|00000970| 76 65 64 20 41 35 20 2a | 2f 0d 09 0d 09 09 09 09 |ved A5 *|/.......|
|00000980| 09 09 09 2f 2a 20 4e 6f | 77 20 77 65 20 63 61 6e |.../* No|w we can|
|00000990| 20 61 63 63 65 73 73 20 | 67 6c 6f 62 61 6c 73 20 | access |globals |
|000009a0| 2a 2f 0d 09 44 6f 56 42 | 4c 20 28 72 65 63 50 74 |*/..DoVB|L (recPt|
|000009b0| 72 29 3b 09 09 09 2f 2a | 20 43 61 6c 6c 20 61 6e |r);.../*| Call an|
|000009c0| 6f 74 68 65 72 20 72 6f | 75 74 69 6e 65 20 74 6f |other ro|utine to|
|000009d0| 20 64 6f 20 61 63 74 75 | 61 6c 20 77 6f 72 6b 20 | do actu|al work |
|000009e0| 2a 2f 0d 09 0d 09 28 76 | 6f 69 64 29 20 53 65 74 |*/....(v|oid) Set|
|000009f0| 41 35 20 28 63 75 72 41 | 35 29 3b 09 09 2f 2a 20 |A5 (curA|5);../* |
|00000a00| 52 65 73 74 6f 72 65 20 | 6f 6c 64 20 41 35 20 2a |Restore |old A5 *|
|00000a10| 2f 0d 7d 0d 0d 2f 2a 0d | 20 2a 20 20 49 6e 73 74 |/.}../*.| * Inst|
|00000a20| 61 6c 6c 56 42 4c 20 63 | 72 65 61 74 65 73 20 61 |allVBL c|reates a|
|00000a30| 20 64 69 61 6c 6f 67 20 | 6a 75 73 74 20 74 6f 20 | dialog |just to |
|00000a40| 64 65 6d 6f 6e 73 74 72 | 61 74 65 20 74 68 61 74 |demonstr|ate that|
|00000a50| 20 74 68 65 20 67 6c 6f | 62 61 6c 20 76 61 72 69 | the glo|bal vari|
|00000a60| 61 62 6c 65 0d 20 2a 20 | 20 69 73 20 62 65 69 6e |able. * | is bein|
|00000a70| 67 20 75 70 64 61 74 65 | 64 20 62 79 20 74 68 65 |g update|d by the|
|00000a80| 20 56 42 4c 20 54 61 73 | 6b 2e 20 20 42 65 66 6f | VBL Tas|k. Befo|
|00000a90| 72 65 20 69 6e 73 74 61 | 6c 6c 69 6e 67 20 74 68 |re insta|lling th|
|00000aa0| 65 20 56 42 4c 2c 20 77 | 65 20 73 74 6f 72 65 0d |e VBL, w|e store.|
|00000ab0| 20 2a 20 20 6f 75 72 20 | 41 35 20 69 6e 20 74 68 | * our |A5 in th|
|00000ac0| 65 20 61 63 74 75 61 6c | 20 56 42 4c 20 54 61 73 |e actual| VBL Tas|
|00000ad0| 6b 20 72 65 63 6f 72 64 | 2c 20 75 73 69 6e 67 20 |k record|, using |
|00000ae0| 53 65 74 43 75 72 72 65 | 6e 74 41 35 20 64 65 73 |SetCurre|ntA5 des|
|00000af0| 63 72 69 62 65 64 20 69 | 6e 0d 20 2a 20 20 54 65 |cribed i|n. * Te|
|00000b00| 63 68 20 4e 6f 74 65 20 | 23 32 30 38 2e 20 20 57 |ch Note |#208. W|
|00000b10| 65 27 6c 6c 20 72 75 6e | 20 74 68 65 20 56 42 4c |e'll run| the VBL|
|00000b20| 2c 20 73 68 6f 77 69 6e | 67 20 74 68 65 20 63 6f |, showin|g the co|
|00000b30| 75 6e 74 65 72 20 62 65 | 69 6e 67 20 69 6e 63 72 |unter be|ing incr|
|00000b40| 65 6d 65 6e 74 65 64 2c | 0d 20 2a 20 20 75 6e 74 |emented,|. * unt|
|00000b50| 69 6c 20 74 68 65 20 6d | 6f 75 73 65 20 62 75 74 |il the m|ouse but|
|00000b60| 74 6f 6e 20 69 73 20 63 | 6c 69 63 6b 65 64 2e 20 |ton is c|licked. |
|00000b70| 20 54 68 65 6e 20 77 65 | 20 72 65 6d 6f 76 65 20 | Then we| remove |
|00000b80| 74 68 65 20 56 42 4c 20 | 54 61 73 6b 2c 20 63 6c |the VBL |Task, cl|
|00000b90| 6f 73 65 20 74 68 65 0d | 20 2a 20 20 64 69 61 6c |ose the.| * dial|
|00000ba0| 6f 67 2c 20 61 6e 64 20 | 72 65 6d 6f 76 65 20 74 |og, and |remove t|
|00000bb0| 68 65 20 6d 6f 75 73 65 | 20 64 6f 77 6e 20 65 76 |he mouse| down ev|
|00000bc0| 65 6e 74 73 20 74 6f 20 | 70 72 65 76 65 6e 74 20 |ents to |prevent |
|00000bd0| 74 68 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |the appl|ication |
|00000be0| 66 72 6f 6d 0d 20 2a 20 | 20 62 65 69 6e 67 20 69 |from. * | being i|
|00000bf0| 6e 61 64 76 65 72 74 65 | 6e 74 6c 79 20 73 77 69 |nadverte|ntly swi|
|00000c00| 74 63 68 65 64 20 62 79 | 20 4d 75 6c 74 69 46 69 |tched by| MultiFi|
|00000c10| 6e 64 65 72 2e 0d 20 2a | 2f 0d 76 6f 69 64 20 49 |nder.. *|/.void I|
|00000c20| 6e 73 74 61 6c 6c 43 56 | 42 4c 20 28 29 0d 7b 0d |nstallCV|BL ().{.|
|00000c30| 09 56 42 4c 52 65 63 09 | 09 09 74 68 65 56 42 4c |.VBLRec.|..theVBL|
|00000c40| 52 65 63 3b 0d 09 44 69 | 61 6c 6f 67 50 74 72 09 |Rec;..Di|alogPtr.|
|00000c50| 09 09 69 6e 66 6f 44 50 | 74 72 3b 0d 09 44 69 61 |..infoDP|tr;..Dia|
|00000c60| 6c 6f 67 52 65 63 6f 72 | 64 09 09 69 6e 66 6f 44 |logRecor|d..infoD|
|00000c70| 53 74 6f 72 61 67 65 3b | 0d 09 53 74 72 32 35 35 |Storage;|..Str255|
|00000c80| 09 09 09 6e 75 6d 53 74 | 72 3b 0d 09 4f 53 45 72 |...numSt|r;..OSEr|
|00000c90| 72 09 09 09 74 68 65 45 | 72 72 3b 0d 09 48 61 6e |r...theE|rr;..Han|
|00000ca0| 64 6c 65 09 09 09 74 68 | 65 49 74 65 6d 48 61 6e |dle...th|eItemHan|
|00000cb0| 64 6c 65 3b 0d 09 73 68 | 6f 72 74 09 09 09 74 68 |dle;..sh|ort...th|
|00000cc0| 65 49 74 65 6d 54 79 70 | 65 3b 0d 09 6c 6f 6e 67 |eItemTyp|e;..long|
|00000cd0| 09 09 09 6c 43 6f 75 6e | 74 65 72 3b 0d 09 52 65 |...lCoun|ter;..Re|
|00000ce0| 63 74 09 09 09 09 74 68 | 65 52 65 63 74 3b 0d 0d |ct....th|eRect;..|
|00000cf0| 09 67 43 6f 75 6e 74 65 | 72 20 3d 20 30 3b 09 09 |.gCounte|r = 0;..|
|00000d00| 09 09 2f 2a 20 49 6e 69 | 74 69 61 6c 69 7a 65 20 |../* Ini|tialize |
|00000d10| 6f 75 72 20 67 6c 6f 62 | 61 6c 20 63 6f 75 6e 74 |our glob|al count|
|00000d20| 65 72 20 2a 2f 0d 09 69 | 6e 66 6f 44 50 74 72 20 |er */..i|nfoDPtr |
|00000d30| 3d 20 47 65 74 4e 65 77 | 44 69 61 6c 6f 67 20 28 |= GetNew|Dialog (|
|00000d40| 72 49 6e 66 6f 44 69 61 | 6c 6f 67 2c 20 28 50 74 |rInfoDia|log, (Pt|
|00000d50| 72 29 20 26 69 6e 66 6f | 44 53 74 6f 72 61 67 65 |r) &info|DStorage|
|00000d60| 2c 20 28 57 69 6e 64 6f | 77 50 74 72 29 20 2d 31 |, (Windo|wPtr) -1|
|00000d70| 29 3b 0d 09 44 72 61 77 | 44 69 61 6c 6f 67 20 28 |);..Draw|Dialog (|
|00000d80| 69 6e 66 6f 44 50 74 72 | 29 3b 0d 09 47 65 74 44 |infoDPtr|);..GetD|
|00000d90| 49 74 65 6d 20 28 69 6e | 66 6f 44 50 74 72 2c 20 |Item (in|foDPtr, |
|00000da0| 72 53 74 61 74 54 65 78 | 74 49 74 65 6d 2c 20 26 |rStatTex|tItem, &|
|00000db0| 74 68 65 49 74 65 6d 54 | 79 70 65 2c 20 26 74 68 |theItemT|ype, &th|
|00000dc0| 65 49 74 65 6d 48 61 6e | 64 6c 65 2c 20 0d 09 09 |eItemHan|dle, ...|
|00000dd0| 26 74 68 65 52 65 63 74 | 29 3b 0d 09 0d 09 2f 2a |&theRect|);..../*|
|00000de0| 20 0d 09 20 2a 20 20 53 | 74 6f 72 65 20 74 68 65 | .. * S|tore the|
|00000df0| 20 63 75 72 72 65 6e 74 | 20 76 61 6c 75 65 20 6f | current| value o|
|00000e00| 66 20 41 35 20 69 6e 20 | 74 68 65 20 4d 79 41 35 |f A5 in |the MyA5|
|00000e10| 20 66 69 65 6c 64 2e 20 | 20 46 6f 72 20 6d 6f 72 | field. | For mor|
|00000e20| 65 0d 09 20 2a 20 20 69 | 6e 66 6f 72 6d 61 74 69 |e.. * i|nformati|
|00000e30| 6f 6e 20 6f 6e 20 53 65 | 74 43 75 72 72 65 6e 74 |on on Se|tCurrent|
|00000e40| 41 35 2c 20 73 65 65 20 | 54 65 63 68 20 4e 6f 74 |A5, see |Tech Not|
|00000e50| 65 20 23 32 30 38 20 2d | 20 22 53 65 74 74 69 6e |e #208 -| "Settin|
|00000e60| 67 20 61 6e 64 0d 09 20 | 2a 20 20 52 65 73 74 6f |g and.. |* Resto|
|00000e70| 72 69 6e 67 20 41 35 22 | 2e 0d 09 20 2a 2f 0d 09 |ring A5"|... */..|
|00000e80| 74 68 65 56 42 4c 52 65 | 63 2e 56 42 4c 41 35 20 |theVBLRe|c.VBLA5 |
|00000e90| 3d 20 53 65 74 43 75 72 | 72 65 6e 74 41 35 20 28 |= SetCur|rentA5 (|
|00000ea0| 29 3b 0d 09 2f 2a 20 53 | 65 74 20 74 68 65 20 61 |);../* S|et the a|
|00000eb0| 64 64 72 65 73 73 20 6f | 66 20 6f 75 72 20 72 6f |ddress o|f our ro|
|00000ec0| 75 74 69 6e 65 20 2a 2f | 0d 09 74 68 65 56 42 4c |utine */|..theVBL|
|00000ed0| 52 65 63 2e 74 68 65 56 | 42 4c 54 61 73 6b 2e 76 |Rec.theV|BLTask.v|
|00000ee0| 62 6c 41 64 64 72 20 3d | 20 28 56 42 4c 50 72 6f |blAddr =| (VBLPro|
|00000ef0| 63 50 74 72 29 20 53 74 | 61 72 74 56 42 4c 3b 0d |cPtr) St|artVBL;.|
|00000f00| 09 74 68 65 56 42 4c 52 | 65 63 2e 74 68 65 56 42 |.theVBLR|ec.theVB|
|00000f10| 4c 54 61 73 6b 2e 76 62 | 6c 43 6f 75 6e 74 20 3d |LTask.vb|lCount =|
|00000f20| 20 49 4e 54 45 52 56 41 | 4c 3b 20 2f 2a 20 46 72 | INTERVA|L; /* Fr|
|00000f30| 65 71 75 65 6e 63 79 20 | 6f 66 20 74 61 73 6b 2c |equency |of task,|
|00000f40| 20 69 6e 20 74 69 63 6b | 73 20 2a 2f 0d 09 74 68 | in tick|s */..th|
|00000f50| 65 56 42 4c 52 65 63 2e | 74 68 65 56 42 4c 54 61 |eVBLRec.|theVBLTa|
|00000f60| 73 6b 2e 71 54 79 70 65 | 20 3d 20 76 54 79 70 65 |sk.qType| = vType|
|00000f70| 3b 09 20 20 2f 2a 20 71 | 45 6c 65 6d 65 6e 74 20 |;. /* q|Element |
|00000f80| 69 73 20 61 20 56 42 4c | 20 74 61 73 6b 20 2a 2f |is a VBL| task */|
|00000f90| 0d 09 74 68 65 56 42 4c | 52 65 63 2e 74 68 65 56 |..theVBL|Rec.theV|
|00000fa0| 42 4c 54 61 73 6b 2e 76 | 62 6c 50 68 61 73 65 20 |BLTask.v|blPhase |
|00000fb0| 3d 20 30 3b 0d 09 0d 09 | 2f 2a 20 4e 6f 77 20 69 |= 0;....|/* Now i|
|00000fc0| 6e 73 74 61 6c 6c 20 74 | 68 65 20 56 42 4c 20 74 |nstall t|he VBL t|
|00000fd0| 61 73 6b 20 2a 2f 0d 09 | 74 68 65 45 72 72 20 3d |ask */..|theErr =|
|00000fe0| 20 56 49 6e 73 74 61 6c | 6c 20 28 28 51 45 6c 65 | VInstal|l ((QEle|
|00000ff0| 6d 50 74 72 29 26 74 68 | 65 56 42 4c 52 65 63 2e |mPtr)&th|eVBLRec.|
|00001000| 74 68 65 56 42 4c 54 61 | 73 6b 29 3b 0d 09 0d 09 |theVBLTa|sk);....|
|00001010| 69 66 20 28 21 74 68 65 | 45 72 72 29 20 7b 0d 09 |if (!the|Err) {..|
|00001020| 09 6c 43 6f 75 6e 74 65 | 72 20 3d 20 2d 31 3b 09 |.lCounte|r = -1;.|
|00001030| 09 2f 2a 20 46 6f 72 63 | 65 20 74 68 65 20 69 6e |./* Forc|e the in|
|00001040| 69 74 69 61 6c 20 75 70 | 64 61 74 65 20 2a 2f 0d |itial up|date */.|
|00001050| 09 09 64 6f 20 7b 0d 09 | 09 09 69 66 20 28 6c 43 |..do {..|..if (lC|
|00001060| 6f 75 6e 74 65 72 20 21 | 3d 20 67 43 6f 75 6e 74 |ounter !|= gCount|
|00001070| 65 72 29 20 7b 0d 09 09 | 09 09 4e 75 6d 54 6f 53 |er) {...|..NumToS|
|00001080| 74 72 69 6e 67 20 28 67 | 43 6f 75 6e 74 65 72 2c |tring (g|Counter,|
|00001090| 20 6e 75 6d 53 74 72 29 | 3b 0d 09 09 09 09 53 65 | numStr)|;.....Se|
|000010a0| 74 49 54 65 78 74 20 28 | 74 68 65 49 74 65 6d 48 |tIText (|theItemH|
|000010b0| 61 6e 64 6c 65 2c 20 6e | 75 6d 53 74 72 29 3b 0d |andle, n|umStr);.|
|000010c0| 09 09 09 09 6c 43 6f 75 | 6e 74 65 72 20 3d 20 67 |....lCou|nter = g|
|000010d0| 43 6f 75 6e 74 65 72 3b | 0d 09 09 09 7d 0d 09 09 |Counter;|....}...|
|000010e0| 7d 20 77 68 69 6c 65 20 | 28 21 42 75 74 74 6f 6e |} while |(!Button|
|000010f0| 20 28 29 29 3b 0d 09 09 | 74 68 65 45 72 72 20 3d | ());...|theErr =|
|00001100| 20 56 52 65 6d 6f 76 65 | 20 28 28 51 45 6c 65 6d | VRemove| ((QElem|
|00001110| 50 74 72 29 26 74 68 65 | 56 42 4c 52 65 63 2e 74 |Ptr)&the|VBLRec.t|
|00001120| 68 65 56 42 4c 54 61 73 | 6b 29 3b 09 2f 2a 20 52 |heVBLTas|k);./* R|
|00001130| 65 6d 6f 76 65 20 69 74 | 20 77 68 65 6e 20 64 6f |emove it| when do|
|00001140| 6e 65 20 2a 2f 0d 09 7d | 0d 09 0d 09 2f 2a 20 46 |ne */..}|..../* F|
|00001150| 69 6e 69 73 68 20 75 70 | 20 2a 2f 0d 09 43 6c 6f |inish up| */..Clo|
|00001160| 73 65 44 69 61 6c 6f 67 | 20 28 69 6e 66 6f 44 50 |seDialog| (infoDP|
|00001170| 74 72 29 3b 09 09 09 09 | 2f 2a 20 47 65 74 20 72 |tr);....|/* Get r|
|00001180| 69 64 20 6f 66 20 6f 75 | 72 20 64 69 61 6c 6f 67 |id of ou|r dialog|
|00001190| 20 2a 2f 0d 09 46 6c 75 | 73 68 45 76 65 6e 74 73 | */..Flu|shEvents|
|000011a0| 20 28 6d 44 6f 77 6e 4d | 61 73 6b 2c 20 30 29 3b | (mDownM|ask, 0);|
|000011b0| 09 09 09 2f 2a 20 46 6c | 75 73 68 20 61 6c 6c 20 |.../* Fl|ush all |
|000011c0| 6d 6f 75 73 65 20 64 6f | 77 6e 20 65 76 65 6e 74 |mouse do|wn event|
|000011d0| 73 20 2a 2f 0d 7d 0d 00 | 00 00 00 00 00 00 00 00 |s */.}..|........|
|000011e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001200| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00001210| 74 72 29 26 74 68 65 56 | 42 4c 52 65 63 2e 74 68 |tr)&theV|BLRec.th|
|00001220| 65 56 42 4c 54 61 73 6b | 29 3b 09 2f 2a 20 52 65 |eVBLTask|);./* Re|
|00001230| 0f 63 6f 6d 70 61 74 69 | 62 69 6c 69 74 79 2e 63 |.compati|bility.c|
|00001240| 02 00 00 00 54 45 58 54 | 4d 50 53 20 01 00 00 01 |....TEXT|MPS ....|
|00001250| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 01 00 69 |..TEXTMP|S .....i|
|00001260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001270| 00 00 a1 3d 45 44 00 00 | 11 57 00 00 01 7e 72 69 |...=ED..|.W...~ri|
|00001280| 64 20 6f 66 20 6f 75 72 | 20 64 69 61 6c 6f 67 20 |d of our| dialog |
|00001290| 2a 2f 0d 09 46 6c 75 73 | 68 45 76 65 6e 74 73 20 |*/..Flus|hEvents |
|000012a0| 28 6d 44 6f 77 6e 4d 61 | 73 6b 2c 20 30 29 3b 09 |(mDownMa|sk, 0);.|
|000012b0| 09 09 2f 2a 20 46 6c 75 | 73 68 20 61 6c 6c 20 6d |../* Flu|sh all m|
|000012c0| 6f 75 73 65 20 64 6f 77 | 6e 20 65 76 65 6e 74 73 |ouse dow|n events|
|000012d0| 20 2a 2f 0d 7d 0d 00 56 | 32 3c 01 16 4e ba 00 4e | */.}..V|2<..N..N|
|000012e0| 32 3c 01 1a 4e ba 00 46 | 32 3c 00 e2 4e ba 00 3e |2<..N..F|2<..N..>|
|000012f0| 32 3c 00 e6 4e ba 00 36 | 32 3c 00 ea 4e ba 00 2e |2<..N..6|2<..N...|
|00001300| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 01 d1 |...H..Mo|naco....|
|00001310| 00 00 02 5e 00 6f 01 d1 | 00 6f 02 5e 00 7e 02 41 |...^.o..|.o.^.~.A|
|00001320| 00 7e 02 5e 00 a8 00 06 | 00 04 00 3f 00 03 01 b5 |.~.^....|...?....|
|00001330| 02 2d 00 3f 00 03 01 b5 | 02 2d a1 5f 99 3e 00 00 |.-.?....|.-._.>..|
|00001340| 0f fa 00 00 10 1e 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|00001350| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 29 ac 78 |...L...L|...2.).x|
|00001360| 04 0c 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00001370| 00 0a 03 ed ff ff 00 00 | 00 00 00 2b 44 98 00 00 |........|...+D...|
+--------+-------------------------+-------------------------+--------+--------+